UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'V+MmEKV/toiwURFkFssdlHgqd4NSOt/5TFpIlEPyZCo='
WHERE
key_id = 'dead2e81b46d0bc0d631efdb4e5ab67e4aa6419211ef5e8a8e52477d50a95cce'
AND (
token = 'V+MmEKV/toiwURFkFssdlHgqd4NSOt/5TFpIlEPyZCo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)