UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ORQ/K5eJhUN8yaLCv1bPJWcZVer61gd0fdWO4KbfVfo='
WHERE
key_id = 'cafc13139afe9c2d3e7edc57ad5b6eeb4bd7891c6e66dec267a1b0f61fe9ad4f'
AND (
token = 'ORQ/K5eJhUN8yaLCv1bPJWcZVer61gd0fdWO4KbfVfo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)