Sounds like you need MySQL cluster :lol:
Seriously though, don't ever run two concurrent modifiable instances of the same database if you intend to synchronise them, it really isn't a good idea.
In fact, what you could to do is forego the primary key alltogether on these tables and rely instead on a non-unique index. You might capture some other data (an identifier for the source of the row, eg your phone, macbook etc) that in conjunction with the non-unique index is used as a unique index.