The locking only happens when you do that huge user querying without specifying a `LIMIT`.

Deleting each individual within a loop in PHP won't actually lock the database until that loop is done. The database will be yielded for other processes in between each delete so there's no contention there.

This and memory issues are why we needed to do this using the batch approach. I did the testing and it doesn't have any memory leaks as well as db locking issues.