By update username, do you mean re-assign? If so, using the REST API you could use the claim task API [1]

Edit: Just noticed there is a field called user name. You could update the process variable using the variable REST API [2]. Given there is a form, you could change the value via the form unless the field is read only. If you update via the form, the form SDK takes care of updating the process varaible.