It may be worth adding a `LIMIT 1000` or similar to these deletes, so that they don't run for too long and tie up db resources.  Since we don't index on createdAt, each delete here is going to be a full table scan.

(We should also consider indexing on createdAt; sync has a similar index explicitly for use by its ttl pruning script)