UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZkqfRcqqO+d8X+EPg/0BdFbGGIHhxxW6UyddupfLuTM='
WHERE
key_id = 'ebc213dd43fb7c79f16e21cff54ba0b610aa1c4f034d98e1e7339c3e8fc433cf'
AND (
token = 'ZkqfRcqqO+d8X+EPg/0BdFbGGIHhxxW6UyddupfLuTM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)