SELECT...FOR UPDATE - Will only an UPDATE release the lock?
Don't know about MySQL, but in Postgresql, the lock is only valid for the duration of the current transaction, so:


you must have started a transaction
the lock will be released if you commit or rollback the transaction


If you don't start an explicit transaction, then the lock will be released right away.