The best way to approach this would be to create a stored procedure which takes all the details as parameters, and uses a Transaction to ensure that either both updates are done, or neither of them.
If you have a look here:
http://www.4guysfromrolla.com/webtech/080305-1.shtml[
^] it gives an example, but using deletes instead of inserts, but the principle is exactly the same.