Hi @damelco,
The WooCommerce wc_update_340_state
function is defined in /includes/wc-update-functions.php.
https://github.com/woocommerce/woocommerce/blob/b18e2437f482bbc05a2da49ef89221fd373d140a/plugins/woocommerce/includes/wc-update-functions.php#L1744
It seems there was a similar behavior on a few sites a while back, due to the update scripts not setting up all the required database tables. But this was fixed long ago.
Once the WooCommerce update is done, can you head to WooCommerce > Status > Tools, regenerate product lookup tables and verify base database tables on that page?
Link to images:
https://d.pr/i/PQiztW
https://snipboard.io/OXcbBN.jpg
It may take a few minutes to complete. If this doesn’t help either it means that there’s a wider problem with Action Scheduler or WP-Cron in general, so you might want to use WP Crontrol plugin as suggested above.
Cheers.