UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EEeqUYsj7zOR8/RdqaTo6KCFtQrhOig1JGVYv2GDJO4='
WHERE
key_id = '47d70ba1f0e11fa4dabf426fc5f69ac41cacc5293efb7de6bd898b1a9e2b430b'
AND (
token = 'EEeqUYsj7zOR8/RdqaTo6KCFtQrhOig1JGVYv2GDJO4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)