UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cJWfqtP0ylZRfRczo2Rxi1l/3wi9QjNvYITe9PHHzv4='
WHERE
key_id = '64028cdc793e63bf4410bfe8cabd1073d3a0814714f8760b315ffb5baccc6465'
AND (
token = 'cJWfqtP0ylZRfRczo2Rxi1l/3wi9QjNvYITe9PHHzv4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)