Pulling log messages from a MySQL table
Instead of joining the data of two tables in Python, you should une an SQL join query to ask the database do the work for you.

You also should not inject parameters directly into the query and let the driver do it for you by means of parametrized queries.

Lastly, a list-comprehension is better suited to build your output than using append.

Proposed improvements:

def get_logs_messages(request_id, destination=None):
    parameters = (request_id,)
    query = (
        'SELECT logs.modified_dt, logs.message '
        'FROM scripts_deployment_logs AS logs '
        'LEFT JOIN deployment ON logs.deployment_id = deployment.deployment_id '
        'WHERE deployment.request_id = %s'
    )

    if destination is not None:
        query += ' AND deployment.destination = %s'
        parameters = (request_id, destination)

    conn = MySQLdb.connect(**dbconfig)
    cursor = conn.cursor()
    cursor.execute(query, parameters)
    messages = [
        '{}: {}'.format(dt, message)
        for dt, message in cursor.fetchall()
    ]
    cursor.close()
    return messages