UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QKN2oQXrXJKaMR/Mjz8ZMM3wn8hfIeXRrJ+xSUzK6Pc='
WHERE
key_id = 'faa1d3cb10119c92e0ec60a3f3ccb90b4c76735704292f971313cfc4bd8b0baa'
AND (
token = 'QKN2oQXrXJKaMR/Mjz8ZMM3wn8hfIeXRrJ+xSUzK6Pc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)