Get lock cache on mysql improve

Here is the suggested code that was implemented and is related to #1