I have a table with fields foreign_key_id | value1 | value2, and I want to update value2 if I have a match for foreign_key_id and value1.
If foreign_key_id or value
Best option: Use REPLACE instead of INSERT or UPDATE. It depends on the use of a primary key or unique key.
INSERT
UPDATE