Apache::Session::Lock::MySQL has this:
my $sth = $self->{dbh}->prepare_cached(q{SELECT GET_LOCK(?, 3600)},
{}, 1);
$sth->execute($self->{lockid});
It does not, however, fetch from sth, so you do not know if you obtained
a lock . My understanding of GET_LOCK() is that it returns 0 or 1 (or
null on error) depending on whether you got the lock or not.