UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'm2FbXOULtYC8ROACU/J7nPLSoAm3VLQeuiskwWZprgk='
WHERE
key_id = 'ccca638b302150ac6aea1859a1b135f322e9fb38d30107d932a5465b3323a613'
AND (
token = 'm2FbXOULtYC8ROACU/J7nPLSoAm3VLQeuiskwWZprgk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)