I want to insert data into a table but if data exist I want to update but if one column is set to "1" I want that it updates some columns and others doesn't in order to not lose some state, anybody knows how to do it? triggers ? 

If existe (
If columnA is 1 then update but keep columnA and ColumnB otherwise update al columns ) else insert