sql update statement with join in where clause