lately our Dynamics CRM 365 On-prem has been experiencing daily problems. App crashes fully with only thing in event logs that tells us anything:

Query execution time of 37.7 seconds exceeded the threshold of 10 seconds. Thread: 20; Database: ****; Server:****; Query: sp_getapplock.

and this repeats many times over the history.

When querying database (MS SQL server 16) for which sessions are active it reports:

<?query -- xp_userlock --?>

which is being executed by default user under which CRM itself runs on server.

As for the time frame this happens usually only once per day, but on completely unrelated hours.

Does anyone have any ideas why this would be happening since we are running completely out of them?