def METHOD_NAME(connection, execute_flag, created, id_prefix):
    cursor = connection.cursor(dictionary=True)
    try:
        cursor.execute(SELECT_BY_CREATED_BEFORE_AND_ID_PREFIX_QUERY, (created, '{}%'.format(id_prefix)))
        # TODO For some reason, rowcount comes back as -1. Wonder if it appears after a fetch?
        logger.info('Fetched {} rows to revoke using id_prefix={}, created<{}'.format(cursor.rowcount, id_prefix, created))
        update_tuples = []
        for row in iter_row(cursor, 100):
            envelope_key_record_json = json.loads(row['key_record'])
            # Only update if not already revoked and handle missing Revoked flag
            if not envelope_key_record_json.get('Revoked') or not envelope_key_record_json['Revoked']:
                envelope_key_record_json['Revoked'] = True
                # Note we're appending a tuple
                update_tuples.append((json.dumps(envelope_key_record_json, separators=(',', ":")), row['id'], row['created']))
        if update_tuples:
            if execute_flag:
                # Apparently this may not actually be optimized to a bulk update currently, but maybe it will be someday?
                cursor.executemany(UPDATE_KEY_RECORD_BY_KEY_QUERY, update_tuples)
                logger.info('Marked {} keys revoked successfully!'.format(cursor.rowcount))
                connection.commit()
            else:
                logger.info('DRY-RUN would have run query={} for {} keys'.format(UPDATE_KEY_RECORD_BY_KEY_QUERY, len(update_tuples)))
    finally:
        cursor.close()