sql update where id exists in another table