Query to determine if shot needs published?

I’m trying to use the CSV export to help me generate lists of shots that need to be rendered in After Effects and run them via command line. I see a usable path for the latest published file. But, how can I know if the latest working file is newer or not? If the publish is older, I want to know so I can re-publish the most current version. Is that doable?