MySQL implements internal locks to guarantee consistency across applications and "sessions". A session isn't well defined in the documentation, but I would guess that a session is analogous to a connection, regardless of the username/password used.
I would evaluate why you need or think you need to implement locks specifically. MySQL is designed to be concurrently used by multiple applications, the only reason to use locks is if you need to synchronize data or updates between applications, otherwise both applications can CRUD a table concurrently and maintain consistency.
Read Pgs 1002 to 1008[
^]