Content not getting published (504 gateway timeout)

I have a running site that is functioning well. After updating Drupal to 7.55, the content is not getting published and it throws a 504 gateway timeout error while publishing/editing/unpublishing of content. I am using workbench and work flow modules for moderation of content. Any suggestions on how to get to the root cause of this?

Drupal version: