UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'V95LsUmWuAIlCvjDv26T5kApAscgi/dev2GWO2HyZpY='
WHERE
key_id = '1f69c61f16eb2ac194a6b4842ce512bed04635fdac1a8136c0feb2ee1a605352'
AND (
token = 'V95LsUmWuAIlCvjDv26T5kApAscgi/dev2GWO2HyZpY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)