The red card will open the second safe, but it's inside the first safe, beyond the cogs.
Once you get inside the safe look at the circular platforms.
Those platforms cause the cogs to move.
Jump on the platform, get in a cog, jump on a platform again, jump out, hop into the next cog, etc., until you find a passage in the corner.