You mentioned that the same queries are taking 40ms. One query or 47/50 queries are taking 40ms? If one and you multiply 47 or 50 times then it could be 1,5 - 2 sec (1500ms - 2000ms).
In the case of such a number of queries, I would be interested to know whether you have correctly set the cache for database queries on the application side (a very common problem on environments with Hibernate).