UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'haXeSicZL1zscqtQNBJsRIbfFQ1q/MIk4K1UF0A1HFU='
WHERE
key_id = '2ceac7aa7f0f8d9a19d4ce3c2899797fd607ac677f9b337324e4b6448347239d'
AND (
token = 'haXeSicZL1zscqtQNBJsRIbfFQ1q/MIk4K1UF0A1HFU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)