UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'anHqGGAqw+Zk62qQOZ94ErGWoGc7rsI9vmbSBvaUF8I='
WHERE
key_id = '86fb0905fc2b8468225a37a799265f004a90eb117ebaa15cdd8b49962ede9fad'
AND (
token = 'anHqGGAqw+Zk62qQOZ94ErGWoGc7rsI9vmbSBvaUF8I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)