Get lock cache on mysql improve

Here is the suggested code that was implemented.