UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'K8Mkdzx+kiuySWbAKeveBkHckqVjqZKGv5Kl0MhsAJ0=' 
WHERE 
  key_id = '0914b48f2962babb59f0ed32d28def608452e324baebe5cbdd0a98b788fd83f3' 
  AND (
    token = 'K8Mkdzx+kiuySWbAKeveBkHckqVjqZKGv5Kl0MhsAJ0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031