UPDATE 
  q_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SXcD6jTJXWof/NcQJUWzaSvpEPqFW9k0C/vGFw49SQk=' 
WHERE 
  key_id = 'bf4d19ecc7f8e19940ce7d423b06cc715fd12793ac841909d4f67f5a53796eea' 
  AND (
    token = 'SXcD6jTJXWof/NcQJUWzaSvpEPqFW9k0C/vGFw49SQk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027