split update and insert into one transaction