UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'C7FSR3a4zXGPz3DHhBlPiOUpRfv+n+6fXFgph9ajEsk='
WHERE
key_id = '6a0b09c90c1a353feea0eecf2447ab0069404193307d352d408ca3eb1696c437'
AND (
token = 'C7FSR3a4zXGPz3DHhBlPiOUpRfv+n+6fXFgph9ajEsk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)