You can not do that with Varnish. You can define an "Expires" header like set beresp.http.Expires = XXXX in vcl_fetch. But you can not base the value of your header on an mtime/atime because Varnish never touches files sent by Apache and so can not get access to you mtime/atime.
You could actually send two extra headers from your origin server to inform Varnish about the resource's mtime/atime, something like X-Mtime: 1234 an X-Atime: 1234 so you can fetch them from Varnish with beresp.http.X-Mtime or beresp.http.X-Atime but this looks really overkill to me.
Furthermore you would need Apache/Nginx to send those custom headers for each request and to be honnest I do not know if that is possible to get such informations.
'hope that helps :)