Check if variable is sent
I do not believe the current answer solves your optimization need, I believe the correct answer is to usefindOneAndUpdate.  This will cut down on the steps need to achieve this same goal.  The update function will handle all of the if checks, it will only update fields supplied in the req.body.

User.findOneAndUpdate({ username: req.params.username }, req.body, function (error, User) {
      if (User) {
        res.json({
            success: true,
            message: 'User updated'
        });
      } else {
        // ALWAYS RETURN res.send please
        return res.send(err);
      }
    });


http://mongoosejs.com/docs/api.html#query_Query-findOneAndUpdate for additional docs.

WARNING If res.body has properties that are set as undefined, it will overwrite existing values.  You should validate inputs coming in to ensure this is not the case.