UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hCofmArITYu0mu1czLMcpNTMevWZIyH8VPggYOAOyNE='
WHERE
key_id = '781fff5b5cbabb99700a325ae13e1a59ccb67579b0a92b7b5c6e6f807a07719a'
AND (
token = 'hCofmArITYu0mu1czLMcpNTMevWZIyH8VPggYOAOyNE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)