def quote(string):
    return string.replace("'", "''").replace('"', '""').replace('`', '``')
client = boto3.client('sdb')
query = 'SELECT * FROM `%s` WHERE "%s" = "%s"' % (quote(domain), quote(key),
    quote(value))
How to escape Python boto's SelectExpression for Amazon SimpleDB