Podzapytanie powinno wykonać:
UPDATE `wp_postmeta`
SET `meta_value`= (
CASE
WHEN `meta_key` = '_stock' THEN '0'
WHEN `meta_key` = '_stock_status' THEN 'outofstock'
ELSE `meta_value`
end)
WHERE post_id NOT IN
(
SELECT id
from wp_posts
WHERE post_type = 'product' );