The simplest solution is to set second parameter in the session with value = time()
and then to check with it.
require_once 'app/Mage.php';
Mage::app();
$session = Mage::getSingleton('core/session');
$session->setParam1('some');
$session->setParam2(time());
//in other file or I don't know what is your idea
if ($session->hasParam1($param2) && $session->hasParam2() && $session->getParam2() + 300) > time()) {
//do something with parameterecho 1$session->getParam1();
}