<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def update(self, **kwargs):
 """ Performs an UPDATE statement on the model's table in the master database. :param values: A dictionary of values to update. ``datetime``, ``dict`` and ``bool`` objects can be passed as is and will be correctly serialized by psycopg2. :type values: dict :param where: The WHERE clause. This can be a plain string, a dict or an array. :type where: string, dict, array """

        kwargs['stack'] = self.stack_mark(inspect.stack())
        kwargs['primary_key'] = self.primary_key
        column_names = self.table_schema().keys()
        now = datetime.utcnow()
        if 'updated_at' in column_names:
            kwargs['values']['updated_at'] = now
        results = self.db_adapter(role='master').update(**kwargs)
        return self.record_or_model(results)