Is there any potential problem in using (in a transaction)
SELECT EXISTS( SELECT * FROM mytable WHERE id=36 FOR UPDATE )
SELECT ... FOR UPDATE within an
MySQL does certainly some optimizations for
EXISTS since it doesn't have to actually retrieve the data, and, just in case, was wondering if the row where id=36 will be locked anyway, as expected?