Use a database. Store the link in a column. Then add a timestamp to it. Then, just delete the row when the timestamp is expired.
Or, create a link with the timestamp built in. Then, just extrapolate the timestamp from the link, and decide whether or not it's valid or expired.
~Brett