Just to follow up - turned out it was a crashed table ('xf_class_extension') in the db. Truonglv helped me and everything is resolved. Updating Social groups triggered the problem and added second records where there only should be one (unique index wasn't working).