You could even have MySQL do all of the work for you (assuming you're using MySQL, that is), e.g.:
SELECT col1, col2, ... IF(dateCol < NOW() - INTERVAL 5 MINUTE, '', '1') AS canEdit, ..
Then you'd simply do something like:
if($row['canEdit']) {
// within 5 minutes ...
} else {
// more than 5 minutes ago
}
EDIT: Furthermore, depending upon the schema, you can even have MySQL automatically add the current timestamp to each row being inserted into the table.