UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3n2LCsKs6fMU105BCQKZY6nTVU4PYBat7IPHW6Ui9dU='
WHERE
key_id = '1097a094d68206264e1a19dd8390fc5b15338aea80c7d6373c1db1616278ae4e'
AND (
token = '3n2LCsKs6fMU105BCQKZY6nTVU4PYBat7IPHW6Ui9dU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)