import mysql.connector
cnx = mysql.connector.connect(user='scott', database='test')
cursor = cnx.cursor()
SQL = """
    update my_table 
    set 
    LAY = 'P6682'
    , BLK = 'P6682'
    , ANI = 'P6682'
    where
    Shot = 'SH01';
    update my_table 
    set 
    LAY = '1863'
    , BLK = '1863'
    , ANI = '1863'
    where
    Shot = 'SH02'
"""
for result in cursor.execute(SQL, multi=True):
    pass
cnx.commit()
cur.close()
cnx.close()
cnx.disconnect()
Update database with multiple SQL Statments