call time() once to prevent race conditions

Aslo order delayed sql by time to run queries in chronological order

NB: ordering by time is still not reliable, adding autoincremented
index to delayed sql table may affect performance