Increase the cmd4 (related to SQL operations) timeout by modifying the appsettings.xml:
<!-- Time-out for the execution of database (SQL) commands - in hh:mm:ss format -->
<add key="Db.CommandTimeout" value="00:00:30" />
See also
Preventing browser session timeout
Preventing login timeout in client applications
Preventing interactive workflow timeout