Would using SELECT FOR UPDATE and a subsequent INSERT guarantee uniqueness in text column?
Yes, that should work.  However, consider either of these one-liners:

INSERT IGNORE ...

INSERT ... ON DUPLICATE KEY UPDATE ...


If you are using AUTO_INCREMENT, be cautious about 'burning' ids.

Links:


https://stackoverflow.com/questions/24616315/how-to-use-insert-on-duplicate/24617186
https://stackoverflow.com/documentation/mysql/866/insert