It's more classic to backup state rather than forcing it (to 1):

```mysql
SET @OLD_SQL_SAFE_UPDATES=@@SQL_SAFE_UPDATES;
SET SQL_SAFE_UPDATES=0;
-- perform queries
SET SQL_SAFE_UPDATES=@OLD_SQL_SAFE_UPDATES;
```