UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CNUFmPXskY4ieFCc10fK5ohYMFddUqkX8b3rz5d/MQA='
WHERE
key_id = 'ec4f48062c70dea3644ebfaa016b23ae46f93e1bb66fbc223a9bb1671b37fda6'
AND (
token = 'CNUFmPXskY4ieFCc10fK5ohYMFddUqkX8b3rz5d/MQA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)