UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dtC7O04V33agnQcKy1LlbM0HR5Tr+rG2ZsdrpfbE6Bo='
WHERE
key_id = '84554b8ab82b41e362d0019680d743cb6a8c6dad27adf9a5b386128d6d7c267d'
AND (
token = 'dtC7O04V33agnQcKy1LlbM0HR5Tr+rG2ZsdrpfbE6Bo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)