SPWebApplication webApp = SPWebApplication.Lookup(
new
Uri(
"http://webappURL/"
));
//Use TimeSpan constructor to specify Days, hours, minutes, seconds
webApp.FormDigestSettings.Timeout =
TimeSpan(1, 0, 0);
//Save the changes
webApp.Update();