UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ESpsXbbqHok4pNWuqF2nZmo08cKGoSd3+XuZvIJc4hY='
WHERE
key_id = '91f9853311cf7eb0e412ac5cf72806768973d68ae200908264d42a5cb379be24'
AND (
token = 'ESpsXbbqHok4pNWuqF2nZmo08cKGoSd3+XuZvIJc4hY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)