Check file creation Time minutes and if file older then 5 minutes execute some stuff

Hello all,
Info:

System RedHat 7.5

I need to create a script that based on the creation time,
if the file is older then 5 minutes then execute some stuff, if not exit.

I thought to get the creation time and minutes like this.

CreationTime=$(stat -c %y /tmp/test.log | awk -F" " '{ print $1,$2 }')
Here i need to make the difference between Creation time and actual time
if [ $CreationTime -gt 5 ]
        then
                echo "Bad News" | /usr/sbin/sendmail  -v email@mydomain.com
else
   echo "Exit, everything is ok"
fi

Thanks in advanced for the support.

export filename=/path/to/file/filename
tdiff=$(( `date +%s` - `stat -c %Y $filename` ))   # time in seconds of "now" minus the file mod time in seconds
if  [ $tdiff -ge 300 ] ';   then  
  # 300 seconds = five minutes, change to 360 or another number to suit your idea of 'five minutes old' in seconds
  echo "oops $filename is older than five minutes"

fi

Normally stat stores last accessed time, last modified time and last changed time , but not the creation time. stat -c %Y returns last modified. Maybe it was done because of the meaning and actual use for this value. If creating a copy, should it include creation time? If restoring a file from backup, what should be the value used for the restored file? If creation time is going to be critical to whatever use then a storing system like indexing system, or version control system, etc. needs to be implemented. Not sure if your operating system would want to take such a performance hit just for getting creation time value.

Hello Jim,
thank a lot for the fast response,
here is the final script,

#!/bin/sh

check=$(awk -F "]" -v d="$(LC_ALL=C date --date=-5minutes "+%Y%m%d%H:%M:%S.%6N")" -v abmon="$(LC_ALL=C locale abmon)" '
BEGIN   { for (n=split(abmon, M, ";"); n;n--) nM[M[n]]=sprintf("%02d", n) }
        { split($1, ts, " "); D = ts[5] nM[ts[2]] sprintf("%02d", ts[3]) ts[4] }
(d < D) { print }
' /tmp/test.log | wc -l )

filename=/tmp/test.log 
tdiff=$(( `date +%s` - `stat -c %Y $filename` ))
if  [ $tdiff -ge 300 ] ;   then
  echo "oops $filename is older than five minutes"

if [ -z  $check ]
        then
echo "Exit, everything is ok"
        exit
fi
if [ $check -gt 15 ] ;
        then
                echo "Subject: Bad News, Action Needed"| /usr/sbin/sendmail  -v email@mydomain.com
else
   echo "Exit, everything is ok"
   exit
fi
fi