You incorrectly have both await and .then() for the calls to wixData.query and wixData.update. I don’t know if that’s connected to your problem, but you will need to correct this first. You should only use one of them - whichever you prefer.
See the following for more information regarding coding with Promises: