Row inserted to DB in main app is not available in the different process. Can MySQL defer some queries?
Use Innodb.

Do not use LOCK TABLES.

Do

BEGIN;
-- some SQL statements that need to be treated atomically:
INSERT INTO my_table ...;
INSERT INTO my_queue ...;
COMMIT;


By using BEGIN and COMMIT, you can ignore the setting of autocommit, which may be tripping you up.

There may be some tricky business going on in the queue; please show us the SQL for enqueuing and dequeuing, pluse SHOW CREATE TABLE.