The copy of the install macOS Mojave application is damaged and can't be used to install macOS.
The OP was clearly trying to download Mojave, that is why they were in the App Store.
The OP must have tried to download Mojave before, because the message above means the
App Store has detected a copy or partial copy of Install macOS Mojave.app in the Applications folder.
On the OP's second attempt the App Store would have said 'Open' and not 'Get', clicking on 'Open'
will instruct the mac to open the earlier download of Mojave, therefore if the download is corrupted
in any way you get the message above.
It does not mean the installer that was found has an expired certificate.
If you try to install an expired version of an OS you get a different error message,
which I cannot remember.