Both ways seem to pose a false-positive paradigm. This can be simpler and not have to force the user to spend time making sense of the color-to-label association.
Simply make the “Delete” button more prominent. Make the “Cancel” button less prominent. In regards to the labeling within the buttons, there is no need to put much context into what essentially are simple actions (no/yes? or cancel/delete) as that requires more processing on the users part.
Users will usually associate an action such as “Remove” or “Delete” to red. And, as always, provide a way to “cancel” the action.
I’m not so sure you should be thinking only in terms of red and green. Red has typically been associated with danger, potentially dating back to the middle ages (citation needed). A quick Google image search for “delete” yields almost entirely red images.
To me (and to bootstrap) green indicates success, red indicates danger.
As deleting is a dangerous action I would recommend keeping the delete button red. Are you restricted to using green/red? If so I would recommend using your second image. U.S. stop lights indicate to me that green means “continue.” Using this rationale you could say a green “No, keep it button” means “No, keep it and continue” and a red “Yes, delete it” means “Yes, delete it even though it’s dangerous.” Anyhow, I would consider making the “No, keep it” button blue because it is a pretty standard action color (for instance it is the default color of unstyled links).
Edit: I think @JNMNRD has the best answer on this. Here is @JNMNRD’s image without words. Can you tell which button means delete?
Looking at this from a slightly different angle, where possible you could consider removing the confirmation entirely and switching instead to an “Do/Undo” process.
This method is often used across the Google services:
It has the advantages that it’s culturally neutral and more efficient for the user (one-click rather than two to delete).
Disadvantage is that it is transient link, and it is overridden when another action is taken – for example when reporting another email as spam. It also gets discarded once you logout, lose focus or refresh.
To help avoid these disadvantages, you could consider including some kind of recycle bin functionality on the site much like SharePoint does.