WPDB update row with != in where clause

Here is exmaple code,You will change as per your requirement

$wpdb->query(
    "
    UPDATE $wpdb->posts 
    SET post_parent = 7
    WHERE ID = 15 
        AND post_status="static"
    "
);