Non-qualified 529 distribution due to old scholarship

I am several years out of college but when I attended I had a scholarship that resulted in me having leftover money in my 529 account. I understand that typically scholarships can allow you to withdraw from the 529 for non-qualified expenses without paying the 10% penalty, but is this true if the scholarship was taken prior to the current tax year? Is there a time limit on this exemption? How would I record this in Turbotax?