Optimize SQL Update all rows and Insert new rows