Is GDP the market value of goods consumed or goods produced in a time period?
Goods produced.
In your example, a good is produced in Q1 but sold only in Q2. This adds to Q1 GDP (addition to inventories). For Q2 GDP, there's (i) a subtraction from inventories; and (ii) an addition to consumption—so (i) and (ii) cancel out and there's no net change to Q2 GDP.