Help me understand and resolve MySQL deadlock - "lock mode AUTO-INC waiting"
The schema for n0_table looks like it is straight from Wordpress?  It has multiple inefficiencies.  Revamp it to make queries faster and either eliminate or decrease the frequency of the original problem.

Details:  http://mysql.rjweb.org/doc.php/index_cookbook_mysql#speeding_up_wp_postmeta