UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M2c8e+v3HjIJA4RTbx5w074cxKqA2fgGjWw63F5tCmY='
WHERE
key_id = 'ddb2f488dc4381de6c17294ea0fd4c825b8f69eaecc8ef42aaa5d3380bdf5d73'
AND (
token = 'M2c8e+v3HjIJA4RTbx5w074cxKqA2fgGjWw63F5tCmY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)