I had always used something similar to the following to achieve it:
INSERT INTO TheTable SELECT @primaryKey, @value1, @value2 WHERE NOT EXIST
I don't know if this is the "official" way, but you could try the INSERT, and fall back to UPDATE if it fails.
INSERT
UPDATE