in reply to INSERT or UPDATE, but only when unique
You could define this column as UNIQUE in MySQL, and if the INSERT fails, check if it failed because of a duplicate key. In this case, update the record.