We struggled with this error for days at a client:
While trying to publish a Nintex workflow after some time the error “soap: ServerServerwas unable to process request. — > The context has expired and can no longer be used. (Exception from HRESULT: 0x80090317)0x80090317″
After some thorough investigation and reading up I found this had to do with the user token timing out. The default period being 2 minutes.
To resolve the issue, we go back to the old school STSADM command line tool and run the following to increase the time-out:
stsadm -o setproperty -propertyname token -timeout -propertyvalue <A valid time interval, in minutes>
After increasing the time-out value (I increased it to 4 minutes) the workflow was able to publish successfully.
Since performed the above I did some more researching and came across the following PowerShell script that does the same (although I haven’t test it myself)
if((Get-PSSnapin -Name Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue) -eq $null)
$cs = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
$cs.TokenTimeout = (New-TimeSpan -minutes 2)