Lock a MyIsam table across connections?
I'm using GET_LOCK and RELEASE_LOCK in this situation.


  GET_LOCK() can be used to implement application locks or to simulate
  record locks. Names are locked on a server-wide basis. If a name has
  been locked within one session, GET_LOCK() blocks any request by
  another session for a lock with the same name. This enables clients
  that agree on a given lock name to use the name to perform cooperative
  advisory locking. But be aware that it also enables a client that is
  not among the set of cooperating clients to lock a name, either
  inadvertently or deliberately, and thus prevent any of the cooperating
  clients from locking that name. One way to reduce the likelihood of
  this is to use lock names that are database-specific or
  application-specific. For example, use lock names of the form
  db_name.str or app_name.str.
  
  If multiple clients are waiting for a lock, the order in which they
  will acquire it is undefined. Applications should not assume that
  clients will acquire the lock in the same order that they issued the
  lock requests.


Before running a bunch of statements, run:

SELECT GET_LOCK('my unique lock name', 10);


If it returns 1 (success) go on with your bunch of statements and in the end

SELECT RELEASE_LOCK('my unique lock name');


Add some handling of the timeout case, such as retry few times.

It doesn't matter whether your statements work with one table or many tables, whether they are MyIsam, or not. These application-specific locks are server-wide.