How can I update webform_submission uid in the table, after which the anonymous user has registered?
It sounds like your webform has already been submitted by the time they reach checkout. So essentially, you may need to "Update" the submission with the new user ID.

Check out webform_submission_update:
http://drupalcontrib.org/api/drupal/contributions!webform!includes!webform.submissions.inc/function/webform_submission_update/7