Coding a dynamic SQLite update query where a criterion or assignment may be None?

I’ve coded a routine that returns distinct records from records from a SQLite table:

dbcursor.execute("SELECT DISTINCT c1, c2 FROM t1 WHERE (c1 IS NOT NULL OR c2 IS NOT NULL) ORDER BY c1, c2;")

I then iterate through the resulting records and carry out a series of validations and augmentation which derives two variables to replace all records in table where c1 and c2 have the values initially retrieved.

As she original query shows, every record by have a Sqlite NULL value for c1 or c2, but not both. One or both of the derived replacement values may be NULL (None in Python), depending on the outcome of the validation and augmentation process, and in the event either c1 or c2 needs updating a single update query is triggered to write the changes to ALL records in table t1 where the originally read c1 ,c2 combination are matches.

Therein lies my problem. In the event either of c1 or c2 are indeed NULL when retrieved by the initial query the update statement needs to be modified because the SQLite update statement must specify WHERE (c1 = x AND c2 = y) as the update criterion, whereas in the event either x or y are NULL then the update query needs to specify WHERE (c1 IS NULL and c2 = y) etc.

Is there an efficient / easy way to format the query such that = is dynamically replaced with IS NULL wherever c1 or c2 are in fact NULL?

Here’s the update query I’m using, which obviously on works when neither of baseline_c1 and baseline_c2 are NULL

UPDATE alib
   SET c1 = (?),
       c2 = (?) 
 WHERE (c1 = (?) AND 
        c2 = (?) ) , (replacement_c1, replacement_c2, baseline_c1, baseline_c2))

Is my only option here to step through a series of if statements?

if not c1 and c2:

    dbcursor.execute(f'''UPDATE t1
                           SET c1 = (?),
                               c2 = (?) 
                         WHERE (c1 IS NULL AND 
                                c2 = (?) );''', (replacement_c1, replacement_c2, c2))

elif c1 and not c2:

    dbcursor.execute(f'''UPDATE t1
                           SET c1 = (?),
                               c2 = (?) 
                         WHERE (c1 = (?) AND 
                                c2 IS NULL );''', (replacement_c1, replacement_c2, c1))
else:

    dbcursor.execute(f'''UPDATE t1
       SET c1 = (?),
           c2 = (?) 
     WHERE (c1 = (?) AND 
            c2 = (?) );''', (replacement_c1, replacement_c2, c1, c2))