call the method cursor.execute with string "INSERT INTO %s (cache_key, value, expires) VALUES (%%s, %%s, %%s)",
cursor . execute ( "INSERT INTO %s (cache_key, value, expires) " "VALUES (%%s, %%s, %%s)" % table , [ key , b64encoded , exp ] )