To filter for all records with only South codes only:
SELECT product_id, f.*
FROM table AS a
INNER JOIN LATERAL FLATTEN (input => a.location_codes) AS f
WHERE f.Key = 'South'
To filter for the record which has the value of 'south3':
SELECT product_id, f1.value::varchar AS location_code
FROM table AS a
INNER JOIN LATERAL FLATTEN (input => a.location_codes) AS f
INNER JOIN LATERAL FLATTEN (input =>f.value) AS f1
WHERE f.Key = 'South'
AND f1.value::varchar = 'south3'