But I need to use LIMIT, which can't be used with UPDATE, right? It seems like I need to use ctid somehow, but I'm not finding much information on how to do that.
The basic idea is to start a transaction, select for update, do the update, and then commit the transaction. The select for update will do the "locking". Of course, the table should be indexed appropriately, etc.