Fix MYSQL Lock issue