Not that hard conceptually. A database table with 3 columns:
fileid - unique ID (like an MD5 hash of the filename)
expiry - datetime
path - path to the file
When a user accesses something like: http://example.com/file-share.php?fileid
Then the script on that page grabs the record from the database where fileid is the uniqueID. It then checks the expiry date to make sure the link isn't already expired and then the script simply serves up the file (the path of which is stored in the path column in the database) via Content-Type: application/octet-stream.
This might help you out on how to serve the file:
Best of luck!