The error is due to the UPDATE statement. When updating values in MySQL, you cannot use the VALUES keyword like you would in an INSERT statement. Instead, you need to assign new values directly to the columns.
Use this:
import mysql.connector
item_id = 123 query = ( "UPDATE MyTable " "SET col1 = %s, col2 = %s, col3 = %s, col4 = %s " "WHERE item_id = %s" ) items = (val1, val2, val3, val4, item_id)
cursor.execute(query, items)