This won't be an issue in a scss syntax
An example: http://sassmeister.com/gist/11494141.
Unfortunately sass syntax doesn't support multiple line
http://sass-lang.com/documentation/file.INDENTED_SYNTAX.html#multiline_selectors
You could place the media queries parameters as a variable to have a cleaner indentation and to solve this issue (although it's not the best solution).
$media-queries: "(-webkit-min-device-pixel-ratio: 2) and (min--moz-device-pixel-ratio: 2) and (-o-min-device-pixel-ratio: 2 / 1) and (min-device-pixel-ratio: 2) and (min-resolution: 192dpi) and (min-resolution: 2dppx)"
@media only screen and #{$media-queries}
.logo
background: #F00