UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AfnI0IrSRH6jTY4AHEz8xYxs2RX17MsghTXYewn0SPI='
WHERE
key_id = '08e3eb79d8c9ef88f8403a1284883907cd8c9c1dadb31a4a9ec715c809fae818'
AND (
token = 'AfnI0IrSRH6jTY4AHEz8xYxs2RX17MsghTXYewn0SPI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)