UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BwK8D6HBwmg7PNWH7qo76WtLIAf5ixt33zHMjx8hubg='
WHERE
key_id = '4f1c182f3847ea8f6e55874c03dcb5a4d8c8628b21b7b56596e16ca670507c0a'
AND (
token = 'BwK8D6HBwmg7PNWH7qo76WtLIAf5ixt33zHMjx8hubg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)