The SharePoint object model provides a supported way of updating a record without unlocking it. There's a guide here that describes some of the relevant information. I was able to get a working example (excuse some of the 'basic' naming) in an ItemUpdated event receiver.
SPSecurity.RunWithElevatedPrivileges(delegate()
{
using (SPSite site = new SPSite(properties.SiteId))
{
using (SPWeb web2 = site.OpenWeb(properties.Web.ID))
{
SPListItem item = web2.Lists.GetList(properties.List.ID, false).GetItemById(properties.ListItemId);
Records.BypassLocks(item, delegate(SPListItem newItem)
{
newItem["Title"] = "Hello from code";
newItem.Audit.WriteAuditEvent(SPAuditEventType.Custom, SPAuditEventSource.ObjectModel.ToString(), "<Data>Audit text</Data>");
newItem.SystemUpdate(false);
});
}
}
});
As usual with SPSecurity.RunWithElevatedPrivileges, you must create new SPSite and SPWeb objects, as well as a new SPListItem object otherwise you end up with the error Attempted to perform an unauthorized operation.