if exists (select * from table where PK='value') update table set col1=val1, col2=val2 where PK='value' else insert table (PK, col1, col2) values ('value', val1, val2)