UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dmkmyVlnLv7w51m2cKN+5ZdVemmOp7MtLLCgFue1HAo='
WHERE
key_id = '79f11d6d915db5c409496cee427515bce7c74e44481ad008edd96fd21aadd199'
AND (
token = 'dmkmyVlnLv7w51m2cKN+5ZdVemmOp7MtLLCgFue1HAo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)