UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fZYUT56QFmv2MkWLsLvGnEa8uokKm1WgSksPyZfx+qM='
WHERE
key_id = '6d17e266c6e6890213df4d14b08218008ab82afdd3524f9f2b3e03cb3848e7b7'
AND (
token = 'fZYUT56QFmv2MkWLsLvGnEa8uokKm1WgSksPyZfx+qM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)