If I have a treasure in play, will that treasure reduce the cost of an affinity for artifacts spell and then can I use it to pay for that spell as well?
Yes to both. It is an artifact permanent so it counts toward the cost reduction of affinity for artifacts. And since costs are determined and locked in before you get to activate mana abilities and pay, the reduced cost will stay reduced even if you sac the Treasure token for mana to pay for the spell.
Treasures you control are artifacts, so they count for the purposes of affinity for artifacts (C.R. 205.3g, 702.40a). After figuring the spell's total cost, if the Treasure has "T, Sacrifice this artifact: Add one mana of any color" and the total cost still "includes a mana payment", you can activate that ability (C.R. 601.2f-g, 605.1a), and this doesn't affect the total cost to cast the spell with affinity for artifacts (C.R. 601.2f).
Note that although a "Treasure token", as defined by C.R. 111.10a, is a "colorless Treasure artifact token with" the activated ability just mentioned, the Treasure artifact type itself (C.R. 205.3g) has no abilities or game mechanics inherent to that type, including that activated ability.
EDIT (Jul. 9, 2019): Edited second paragraph to conform to rule update with Core Set 2020.
EDIT (Nov. 23, 2019): Correctness edit.
Former Rules Advisor
"Everything's better with pirates." - Lodge
(The Gamers: Dorkness Rising)
"Any sufficiently analyzed magic is indistinguishable from science."
(Girl Genius - Fairy Tale Theater Break - Cinderella, end of volume 8)
Note that although a "Treasure token", as defined by C.R. 111.10a, is a "colorless Treasure artifact token with" the activated ability just mentioned, the Treasure artifact type itself (C.R. 205.3g) has no abilities or game mechanics inherent to that type, including that activated ability.
EDIT (Jul. 9, 2019): Edited second paragraph to conform to rule update with Core Set 2020.
EDIT (Nov. 23, 2019): Correctness edit.
If you want to, you can double dip your Ixalan Treasures by announcing the spell before you sacrifice them.
Awesome avatar provided by Krashbot @ [Epic Graphics].