UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Dwu2V5iKUJA5kjk7dnrIyX2PeDb21E2tdtF3wN2oY1U=' 
WHERE 
  key_id = '14dae7f03f4b668c087d099ad2af24433d80b6fca79b302a9c8088baddc88c1b' 
  AND (
    token = 'Dwu2V5iKUJA5kjk7dnrIyX2PeDb21E2tdtF3wN2oY1U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034