Have you tried to check that primary key does not exist in the database?
As you added PRIMARY KEY constraint in sql query, you're not doing an insert while there is an existed primary key, even if it has the same value as the row you're trying to update already.