Locking the message_queue table on circulation and reserves will crash Koha, if there are many circulation or/and reservation operations on running and the process_message_queue cron is processing messages. Locking a table is not a very good way to handle digest messages and active queue, this should be handled with a new message status instead.
I investigated this problem further, seems that the issue appears when there are lot of rows in the message_queue table. One of our biggest Koha had last year 1892573 message rows and it takes a while finding messages with pending status.